package org.csmzxy.class2333;

import java.util.concurrent.*;

public class Example07 {
    public static void main(String[] args) {
        ExecutorService pool = new ThreadPoolExecutor(2, 4, 6,
                TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(2),
                Executors.defaultThreadFactory(),
                new ThreadPoolExecutor.AbortPolicy());
        Runnable target = new MyRunnable02();
        for (int i = 0; i < 5; i++) {
            pool.execute(target);
        }
    }
}
